package com.zxl.permission.controller;


import com.alibaba.fastjson.JSONObject;
import com.zxl.permission.service.FeatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RestController
@RequestMapping(value = "/feature")
public class FeatureController {
    @Autowired
    private FeatureService featureService;

    @RequestMapping(value = "/get_menu_list")
    @ResponseBody
    public String getMenuList(@RequestBody Map<String, Object> body, HttpServletResponse rsp) {
        String username = (String) body.get("username");
        JSONObject res = featureService.getMenuList(username);
        return res.toJSONString();
    }
}
